$(function(){
	//lianyungangMap("map");
	showRank("map");//连云港土地等级分布图
	industryBar("chart1");//产业分析柱形图
	enterpriseBar("chart2");//企业数量堆叠柱形图
	scope("chart3");//规模分布饼图
	nature("chart4");//企业性质柱形图
	payTaxLine("chart6");//纳税额企业数量分布
	taxLine("chart7");//纳税月份统计折线图
	/*enterprisePie("chart3");//企业性质类型饼图
	var timeData = ['1月', '2月', '3月','4月','5月','6月','7月'];
	var timeVal = [220, 310, 325, 245, 182, 265, 142];
	areaChange('inout-export','企业月纳税情况',timeData,timeVal);
	powerUsage("powerUsage");//企业用能月分布*/
	var areas = [
		{name:'海州区',value: 389},
		{name:'新浦区',value: 259},
		{name:'连云区',value: 262},
		{name:'赣榆区',value: 324},
		{name:'灌云县',value: 232},
		{name:'东海县',value: 176},
		{name:'灌南县',value: 196}
	];
	var areaNames = ['海州区','新浦区','连云区','赣榆区','灌云县','东海县','灌南县'];
	taxRank("chart5",areas,1,'产值分布');//产值分布排名
	var industrial = [
		{name:'金融',value: 389},
		{name:'文化',value: 259},
		{name:'保险',value: 262},
		{name:'咨询',value: 324},
		{name:'运输',value: 232},
		{name:'卫生',value: 176},
		{name:'教育',value: 196},
		{name:'建筑',value: 214},
		{name:'农业',value: 133},
		{name:'科学',value: 370}
	];
	taxRank("chart9",industrial,2,'行业分布');//行业分布排名
	scope("chart8");//规模分布饼图
	enterpriseTax("tax");//企业纳税柱图
	energyUsage("energy");//企业用能分布图
	propertyGap("property");//产业链关系图表
	relationGap("invest");//投资关系图表
})

//连云港土地等级分布图
function showRank(id) {
	//城市坐标
    var geoCoordMap = {
        '海州区': [119.128258,34.539596],
        '新浦区': [119.254118,34.630208],
        '连云区': [119.369931,34.707693],
        '赣榆区': [119.000906,34.848309],
        '灌云县': [119.346447,34.389008],
        '东海县': [118.756619,34.551059],
        '灌南县': [119.323485,34.143123]
    };
    var data = [
        /*{name: '海州区', value: 1815},
        {name: '新浦区', value: 1295},
        {name: '连云区', value: 1901},
        {name: '赣榆区', value: 1180},
        {name: '灌云县', value: 470},
        {name: '东海县', value: 760},
        {name: '灌南县', value: 350}*/
        {name: '海州区', value1: 185,value2: 913},
        {name: '新浦区', value1: 125,value2: 811},
        {name: '连云区', value1: 191,value2: 742},
        {name: '赣榆区', value1: 30,value2: 432},
        {name: '灌云县', value1: 70,value2: 454},
        {name: '东海县', value1: 60,value2: 393},
        {name: '灌南县', value1: 50,value2: 324}
    ];
    var rawData = [
		{name:'海州区',value:[185, 413]},
		{name:'新浦区',value:[226, 291]},
	    {name:'连云区',value:[316, 501]},
	    {name:'赣榆区',value:[86, 90]},
	    {name:'灌云县',value:[66, 50]},
	    {name:'东海县',value:[76, 40]},
	    {name:'灌南县',value:[46, 60]}
	];
    var echartWidth = $(window).width() * 0.46;
    var echartHeight = $(window).height() * 0.915;
    //初始化echarts
    var myChart = echarts.init(document.getElementById(id));//在id为mainMap的dom元素中显示地图
    //重置大小
    myChart.resize({
        width: echartWidth,
        height: echartHeight,
    });
    var name = 'lianyungang';
    $.get('./js/mapdata/geometryCouties/320700.json', function(geoJson) {
        echarts.registerMap(name, geoJson);
        var convertData = function (data) {
			var res = [];
			for (var i = 0; i < data.length; i++) {
		        var geoCoord = geoCoordMap[data[i].name];
		        if (geoCoord) {
		            res.push({
		                name: data[i].name,
		                value: geoCoord.concat(data[i].value)
		            });
		        }
		   }
			//console.log(res);
		    return res;
		};
        //点击地图下钻判断
		myChart.on('click',function(params){
	        var flag=false;
		     //alert(params.name);
		     if(params.name=='海州区'){
		         console.log(1);
		     }else if(params.name=='连云区'){
		     	console.log(2);
		     }else if(params.name=='新浦区'){
		     	console.log(3);
		     }else if(params.name=='赣榆区'){
		     	console.log(4);
		     	$(".areaMap .backIcon").show();
		     	$(".RBox").eq(0).hide();
				$(".RBox").eq(1).show();
		     }else if(params.name=='灌云县'){
		     	console.log(5);
		     }else if(params.name=='灌南县'){
		     	console.log(6);
		     }else if(params.name == '东海县'){
		     	console.log(7);
		     }else if(params.name == '查看企业分布'){
		     	
	     		$(".content-right").eq(0).hide();
	     		$(".content-right").eq(1).show();
		     }
	    })
		myChart.on("mouseover",function(params){
			if(params.name == '赣榆区'){
				
			}
		})
        myChart.setOption(option = {
            /*title: {
                text: "连云港土地等级分布",
                left: 'center',
                textStyle: {
                    color: '#fff'
                }
            },*/
            tooltip: {
            	trigger: "item",
            	formatter: function (params){
		            var $pna = params.name;
		            var res = '';
		
		            for(var i = 0;i<data.length;i++){
		                if(data[i].name == $pna){
		                    //res='<div> dddddd</div>'
		                    //res = '<img src="'+ $img[i].url +'" />';//设置自定义数据的模板，这里的模板是图片
		                    res = data[i].name +'<br>企业数量：'+data[i].value1+'家<br>产值：'+data[i].value2+'亿';
		                    //console.log(res);
		                    break;
		                }
		            }
		            
		            return res;
		
		        }
            },
            /*visualMap: {
                min: 0,
                max: 2000,
                dimension:0,
                left: 'left',
                top: 'bottom',
                text: ['高', '低'], // 文本，默认为数值文本
                textStyle: {
                	color: '#fff'
                },
                calculable: true,
                inRange: {
                    color: ['#3EACE5', '#F02FC2']
                }
            },*/
        	/*geo: {
        		show: true,
		    	map: name,
		    	zoom: 1.25,//地图缩放比例设置
		        
		        //roam: true,
		        //silent: true,
		        itemStyle: {
		        	show: false,
		            normal: {
                        borderColor: '#fff',
                        borderWidth: 1,
                        areaColor: "rgba(0,0,0,0.3)",//地图区域颜色
                    },
                    emphasis: {
                    	label:{
                    		fontWeight: 'bold',
                    		textStyle: {
			                	color:'#fff150'
			                },
                    	},
                        areaColor: "rgba(0,0,0,0.5)",
                        borderColor: 'rgb(255,222,254)',
                        borderWidth: 1,
                    },
		        },
		        
		    },*/
            series: [{
                type: 'map',
                mapType: name,
                zoom: 1.25,//地图缩放比例设置
                //geoIndex: 0,
                itemStyle: {
                    normal: {
                        borderColor: '#fff',
                        borderWidth: 1,
                        areaColor: "rgba(0,0,0,0.3)",//地图区域颜色
                    },
                    emphasis: {
                    	label:{
                    		
                    		textStyle: {
			                	color:'#fff150',
			                	fontWeight: 'bold',
			                },
                    	},
                        areaColor: "rgba(0,0,0,0.5)",
                        borderColor: '#337ab7',
                        borderWidth: 2,
                        shadowBlur: 2,
                        shadowColor: '#337ab7'
                    },
                    
                },
                label: {//echarts2.x版本的写法，因为label是属于itemStyle的下级，3.0之后跟它同级
                	show: true,
                	formatter: function (params){
			            var $pna = params.name;//对就区域名称
			            var res = '';
			            for(var i = 0;i<data.length;i++){
			                if(data[i].name == $pna){

			                    if($pna == '连云区' || $pna == '海州区' || $pna == '新浦区'){
			                    	res = '{label|'+ data[i].name +'\n'+data[i].value1+'家,'+data[i].value2+'亿}';
			                    }else{
			                    	res = '{label|'+data[i].name +'\n企业：'+data[i].value1+'家\n产值：'+data[i].value2+'亿}';
			                    }
			                    break;
			                }
			            }
			            
			            return res;
			
			        },
			        
			        lineHeight: 20,//不需要加相素单位，似乎需要配置rich富文本才起作用
	                color:'#fff',
	                rich: {//富文本自定义样式
	                	label: {
	                		align: "left",
	                	}
	                }

                },
                animation: true,
                data: data,
                markPoint: {
                	//symbol: 'diamond',
                	//symbolSize: 100,
                	slient: true,
                	label:{
                		normal:{
                			show: true,
                			formatter: function(d){
                				return d.name;
                			}
                		},
                		emphasis:{
                			show: true
                		}
                	},
                	effect: {
                		show:true,
                		shadowBlur: 0
                	},
                	data:[
                		{name: '查看企业分布',coord:[119.000906,34.848309]}
                	]
                }
            },
            {
	            name: '税收收入量',
	            type: 'scatter',//散点（气泡）图
	            coordinateSystem: 'geo',
	            show: false,
	            data: convertData(rawData),
	            /*tooltip: {
	            	trigger: 'item',
		            formatter: function (params) {
		              if(typeof(params.value)[2] == "undefined"){
		              	return params.name + '<br />金额量 : ' + params.value + ' 万';
		              }else{
		              	return params.name + '<br />金额量 : ' + params.value[2] + ' 万';
		              }
		             
		            }
		        },*/
	            symbolSize: function (val) {
	            	//console.log(val);
	                //return (val[2]+val[3]) / 10;
	            },
	            //show: false,
	            label: {//echarts2.x版本的写法，因为label是属于itemStyle的下级，3.0之后跟它同级
                	show: false,
                	formatter: function (params){
			            var $pna = params.name;//对就区域名称
			            var res = '';
			            for(var i = 0;i<data.length;i++){
			                if(data[i].name == $pna){

			                    if($pna == '连云区' || $pna == '海州区' || $pna == '新浦区'){
			                    	res = '{label|'+ data[i].name +'\n'+data[i].value1+'家,'+data[i].value2+'亿}';
			                    }else{
			                    	res = '{label|'+data[i].name +'\n企业：'+data[i].value1+'家\n产值：'+data[i].value2+'亿}';
			                    }
			                    break;
			                }
			            }
			            
			            return res;
			
			        },
			        
			        lineHeight: 20,//不需要加相素单位，似乎需要配置rich富文本才起作用
	                //color:'#fff',
	                rich: {//富文本自定义样式
	                	label: {
	                		color: '#fff',
	                		align: "left",
	                	}
	                },

                },
                emphasis: {
                	label:{
                		show: true,
                		color: '#fff150',
		                fontWeight: 'bold',
		                rich: {//富文本自定义样式
		                	label: {
		                		color: '#fff150',
		                		fontWeight: 'bold',
		                	}
		                },
                	},
                },
	            /*itemStyle: {
                    normal: {
                        borderColor: '#fff',
                        borderWidth: 1,
                        areaColor: "rgba(0,0,0,0.3)",//地图区域颜色
                    },
                    emphasis: {
                    	label:{
                    		fontWeight: 'bold',
                    		textStyle: {
			                	color:'#fff150'
			                },
                    	},
                        areaColor: "rgba(0,0,0,0.5)",
                        borderColor: 'rgb(255,222,254)',
                        borderWidth: 1,
                    },
                    
                },*/
	        },]
        });
        
    });
    
}

//企业数量堆叠柱形图
function enterpriseBar(id){
	var echartWidth = $(window).width() * 0.176;
	var echartHeight = $(window).height() * 0.29;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    //backgroundColor: '#0E2A43',
	    title: {
            text:'企业数量', 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
	    legend: {
	        right: '4%',
	        itemWidth: 14,
	        itemHeight: 5,
	        textStyle:{
	            color:'#fff',
	        },
	        data: ['新增', '已有']
	    },
	    grid: {
	    	top: '15%',
	        left: '3%',
	        right: '4%',
	        bottom: '5%',
	        containLabel: true
	    },
	    
	    tooltip: {
	        show:"true",
	        trigger: 'axis',
	        axisPointer: { // 坐标轴指示器，坐标轴触发有效
	            type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
	        }
	    },
	    xAxis:  [
            {
                type: 'category',
                axisTick : {show: false},
                axisLine: {
                    show: true,
                    lineStyle:{
                        color:'#fff',
                    }
                },
                data: ['1月','2月','3月','4月','5月']
            },
            {
                type: 'category',
                axisLine: {show:false},
                axisTick: {show:false},
                axisLabel: {show:false},
                splitArea: {show:false},
                splitLine: {show:false},
                data: ['1月','2月','3月','4月','5月']
            },
	            
	    ],
	    yAxis: {
	        type: 'value',
	        axisTick : {show: false},
	        axisLine: {
	            show: true,
	            lineStyle:{
	                color:'#fff',
	            }
	        },
	        splitLine: {
	            show: false
	        },
	    },
	    series: [
	        {
	            name: '已有',
	            type: 'bar',
	            xAxisIndex:1,
	            
	            itemStyle:{
	                normal: {
	                    show: true,
	                    color: '#277ace',
	                    barBorderRadius:40,
	                    borderWidth: 0,
	                    borderColor:'#333',
	                }
	            },
	            barGap:'0%',
	            barCategoryGap:'50%',
	            data: [120, 132, 101, 134, 117]
	        },
	        {
	            name: '新增',
	            type: 'bar',
	            itemStyle:{
	                normal: {
	                    show: true,
	                    color: '#5de3e1',
	                    barBorderRadius:40,
	                    borderWidth: 0,
	                    borderColor:'#333',
	                }
	            },
	            barGap:'0%',
	            barCategoryGap:'50%',
	            data: [32, 52, 41, 64, 45]
	        }
	       
	    ]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

//纳税统计折线图
function taxLine(id){
	var echartWidth = $(window).width() * 0.357;
	var echartHeight = $(window).height() * 0.295;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    //backgroundColor: '#394056',
	    title: {
            text:'纳税统计', 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
	    tooltip: {
	        trigger: 'axis',
	        axisPointer: {
	            lineStyle: {
	                color: '#57617B'
	            }
	        },
	        formatter: '{b} <br> {a} : {c}万'
	    },
	    legend: {
	        icon: 'rect',
	        itemWidth: 14,
	        itemHeight: 5,
	        itemGap: 13,
	        data: ['纳税额'/*, '第二产业', '第三产业'*/],
	        right: '4%',
	        textStyle: {
	            fontSize: 12,
	            color: '#F1F1F3'
	        }
	    },
	    grid: {
	    	top: '18%',
	        left: '3%',
	        right: '4%',
	        bottom: '3%',
	        containLabel: true
	    },
	    xAxis: [{
	        type: 'category',
	        boundaryGap: false,
	        axisLine: {
	        	//show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        },
	        data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
	    }, {
	        axisPointer: {
	            show: false
	        },
	        axisLine: {
	        	//show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        },
	        axisTick: {
	            show: false
	        },
	
	        position: 'bottom',
	        offset: 20,
	        data: ['', '', '', '', '', '', '']
	    }],
	    yAxis: [{
	        type: 'value',
	        //name: '单位（%）',
	        axisTick: {
	            show: false
	        },
	        axisLine: {
	        	//show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        },
	        axisLabel: {
	            /*margin: 10,
	            textStyle: {
	                fontSize: 14
	            }*/
	        },
	        splitLine: {
	        	show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        }
	    }],
	    series: [{
	        name: '纳税额',
	        type: 'line',
	        smooth: true,
	        symbol: 'circle',
	        symbolSize: 5,
	        showSymbol: false,
	        lineStyle: {
	            normal: {
	                width: 1
	            }
	        },
	        areaStyle: {
	            normal: {
	                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                    offset: 0,
	                    color: 'rgba(137, 189, 27, 0.6)'
	                }, {
	                    offset: 0.8,
	                    color: 'rgba(137, 189, 27, 0)'
	                }], false),
	                shadowColor: 'rgba(0, 0, 0, 0.3)',
	                shadowBlur: 10
	            }
	        },
	        itemStyle: {
	            normal: {
	                color: 'rgb(137,189,27)',
	                borderColor: 'rgba(137,189,2,0.27)',
	                borderWidth: 12
	
	            }
	        },
	        data: [220, 182, 191, 134, 150, 120, 110, 191, 134, 150, 120, 110]
	    }/*, {
	        name: '第二产业',
	        type: 'line',
	        smooth: true,
	        symbol: 'circle',
	        symbolSize: 5,
	        showSymbol: false,
	        lineStyle: {
	            normal: {
	                width: 1
	            }
	        },
	        areaStyle: {
	            normal: {
	                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                    offset: 0,
	                    color: 'rgba(0, 136, 212, 0.6)'
	                }, {
	                    offset: 0.8,
	                    color: 'rgba(0, 136, 212, 0)'
	                }], false),
	                shadowColor: 'rgba(0, 0, 0, 0.3)',
	                shadowBlur: 10
	            }
	        },
	        itemStyle: {
	            normal: {
	                color: 'rgb(0,136,212)',
	                borderColor: 'rgba(0,136,212,0.2)',
	                borderWidth: 12
	
	            }
	        },
	        data: [120, 110, 125, 145, 122, 165, 122]
	    }, {
	        name: '第三产业',
	        type: 'line',
	        smooth: true,
	        symbol: 'circle',
	        symbolSize: 5,
	        showSymbol: false,
	        lineStyle: {
	            normal: {
	                width: 1
	            }
	        },
	        areaStyle: {
	            normal: {
	                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                    offset: 0,
	                    color: 'rgba(219, 50, 51, 0.6)'
	                }, {
	                    offset: 0.8,
	                    color: 'rgba(219, 50, 51, 0)'
	                }], false),
	                shadowColor: 'rgba(0, 0, 0, 0.3)',
	                shadowBlur: 10
	            }
	        },
	        itemStyle: {
	            normal: {
	
	                color: 'rgb(219,50,51)',
	                borderColor: 'rgba(219,50,51,0.2)',
	                borderWidth: 12
	            }
	        },
	        data: [220, 182, 125, 145, 122, 191, 134]
	    }, */]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}
//企业性质类型饼图
function enterprisePie(id){
	var echartWidth = $(window).width() * 0.336;
	var echartHeight = $(window).height() * 0.22;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    title: {
            text:'登记注册类型', 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
	    tooltip : {
	        trigger: 'item',
	        formatter: "{a} <br/>{b} : {c} ({d}%)"
	    },
	    legend: {
	    	show: false,
	        /*x : 'center',
	        y : 'bottom',
	        textStyle: {
	        	color: '#fff'
	        },
	        data:['当月','上月']*/
	    },
	    color: ['#b6a2de','#5ab1ef','#ffb980','#d87a80','#2ec7c9','#7092be'],
	    calculable : true,
	    series : [
	        {
	            name:'当月',
	            type:'pie',
	            radius : "55%",
	            center : ['25%', '50%'],
	            label: {
		            normal: {
		            	formatter: '{b}\n{d}%',//指示外引显示数据格式
		                textStyle: {
		                    /*color: '#333',*/
		                    fontSize: 12,
		                }
		            }
		        },
		        labelLine: {
		            normal: {
		                show: true//指示外引线段设置
		            }
		        },
	            data:[
	                {value:15, name:'A级'},
	                {value:10, name:'B级'},
	                {value:15, name:'C级'},
	                {value:25, name:'D级'},
	                {value:23, name:'E级'},
	                {value:41, name:'其他'}
	            ]
	        },
	        {
	            name:'上月',
	            type:'pie',
	            radius : "55%",
	            center : ['75%', '50%'],
	            label: {
		            normal: {
		            	formatter: '{b}\n{d}%',//指示外引显示数据格式
		                textStyle: {
		                    /*color: '#333',*/
		                    fontSize: 12,
		                }
		            }
		        },
		        labelLine: {
		            normal: {
		                show: true//指示外引线段设置
		            }
		        },
	            data:[
	                {value:10, name:'A级'},
	                {value:8, name:'B级'},
	                {value:17, name:'C级'},
	                {value:22, name:'D级'},
	                {value:28, name:'E级'},
	                {value:47, name:'其他'}
	            ]
	        }
	    ]
	};

	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}
//纳税额企业数量分布
function payTaxLine(id){
	var echartWidth = $(window).width() * 0.176;
	var echartHeight = $(window).height() * 0.30;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    //backgroundColor:'#fff',
	    title: {
            text:'纳税统计', 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
	    tooltip : {
	        trigger: 'axis',
	        formatter: '纳税额度：{b} <br> 企业数量： {c}家'
	    },
	    legend: {
	    	right: '4%',
	    	textStyle: {
	    		color: '#fff'
	    	},
	        data:['企业数量']
	    },
	     grid: {
	        left: '3%',
	        right: '5%',
	        top:'15%',
	        bottom: '5%',
	        containLabel: true
	    },
	    color:['#fbceb2','#dbb0e3'],
	    calculable : true,
	    xAxis : [
	        {
	            type : 'category',
	            boundaryGap : false,
	            axisLine: {
		        	//show: false,
		            lineStyle: {
		                color: '#FFFFFF'
		            }
		        },
	            data: ['1万','2万','4万','8万','16万','32万','64万','138万','276万','552万','1104万','2208万','4416万','8832万','1亿','2亿',]
	        },
	        
	    ],
	    yAxis : [{
            //name:'投诉立案数',
            type : 'value',
            axisLine: {
	        	//show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        },
	        splitLine: {
	        	show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        }
    	},
	    ],
	    series : [
	        {
	            name:'企业数量',
	            type:'line',
	            areaStyle: {
	                normal: {type: 'default',
	                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                        offset: 0,
	                        color: 'rgba(199, 37, 50,0.2)'
	                    }, {
	                        offset: 1,
	                        color: 'rgba(199, 37, 50,0.8)'
	                    }], false)
	                }
	            },
	            smooth:true,
	            itemStyle: {
	                normal: {areaStyle: {type: 'default'}}    
	            },
	            data:[90, 212, 451,654, 700, 830, 710, 421, 304, 256, 107, 94, 78, 55, 34, 21 ]
	        }
	    ]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

function lianyungangMap(id){
	var rawData = [
		{name:'海州区',value:[28, 19]},
		{name:'新浦区',value:[22, 29]},
	    {name:'连云区',value:[31, 90]},
	    {name:'赣榆区',value:[58, 90]},
	    {name:'灌云县',value:[61, 50]},
	    {name:'东海县',value:[77, 40]},
	    {name:'灌南县',value:[43, 60]}
	];
	var namearr = [ '企业数量', '产值'/*, '3', '4','5','6','7','8'*/ ];
	var color1 = {//渐变颜色1
		colorStops: [{
            offset: 0,
            color: '#ffea00' // 0% 处的颜色
        }, {
            offset: 1,
            color: '#ff00c0' // 100% 处的颜色
        }],
    };
    var color2 = {//渐变颜色2
    	colorStops: [{
            offset: 0,
            color: '#00fff6' // 0% 处的颜色
        }, {
            offset: 1,
            color: '#005aff' // 100% 处的颜色
        }],
    };
	var colorarr = [ color1, color2/*, '#01c3dd', '#008198', '#2ef4ab',	'#ffe074', '#ffcbcb', '#cd8425' */];
	//城市坐标
    var geoCoordMap = {
        '海州区': [119.168258,34.539596],
        '新浦区': [119.284118,34.610208],
        '连云区': [119.349931,34.767693],
        '赣榆区': [119.180906,34.848309],
        '灌云县': [119.446447,34.389008],
        '东海县': [118.756619,34.551059],
        '灌南县': [119.323485,34.093123]
    };
    var data = [
        {name: '海州区', value: 95},
        {name: '新浦区', value: 65},
        {name: '连云区', value: 90},
        {name: '赣榆区', value: 80},
        {name: '灌云县', value: 70},
        {name: '东海县', value: 60},
        {name: '灌南县', value: 50}
    ];
    function formtVData(geoData, data, srcNam) {
        var tGeoDt = [];
        for (var i = 0, len = data.length; i < len; i++) {
            var tNam = data[i].name
            if (srcNam != tNam) {
                tGeoDt.push({
                    name: tNam,
                    value: geoData[tNam]
                });
            }

        }
        tGeoDt.push({
            name: srcNam,
            value: geoData[srcNam],
            symbolSize: 8,
            itemStyle: {
                normal: {
                    color: 'red',
                    borderColor: '#000'
                }
            }
        })
        return tGeoDt;
    }
    var echartWidth = $(window).width() * 0.48;
    var echartHeight = $(window).height() * 0.9;
    //初始化echarts
    var myChart = echarts.init(document.getElementById(id));//在id为mainMap的dom元素中显示地图
    //重置大小
    myChart.resize({
        width: echartWidth,
        height: echartHeight,
    });
    //载入青海地图数据
	$.get('./js/mapdata/geometryCouties/320700.json', function (mapJson) {
        echarts.registerMap('320700', mapJson);
        //设置地图上的各项参数
        myChart.setOption({
            /*title : {
                text:"连云港区域企业产值分布图",
                x:'center',
                textStyle: {
                    color: '#fff'
                }
            },*/
            tooltip: {
                trigger: 'axis',//item,axis
                //formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            /*visualMap: {
                min: 0,
                max: 100000,
                left: 'left',
                top: 'bottom',
                text: ['高', '低'], // 文本，默认为数值文本
                calculable: true,
                color:['lightskyblue','#f2f2f2']
            },*/
            geo: {
            	type: 'map',
                map: '320700',
                label: {
                	normal : {
						textStyle : {
							color : '#fff'
						},
						show : false
					},
                    emphasis: {
                        show: false
                    }
                },
                //silent: true,//定义鼠标在对应区域时是否显示颜色选中
                itemStyle : {
					normal : {
						areaColor : "rgba(0,0,0,0.3)",//地图区域颜色
						borderColor : "#126cc4",
						borderWidth : 1.3
					},
					emphasis : {
						areaColor : "rgba(233,0,200,0.2)"//鼠标悬浮时区域颜色
					}
				}
            },

            series: []
        })

        /*chart.on('click', function (params) {
          var  name = params.name;
            showPie(name);
        });*/
    });
    function renderEachCity() {
		var options = {
			legend:[],
			xAxis : [],
			yAxis : [],
			grid : [],
			series : []
		};
		
		options.legend.push({
	        data : namearr,
	        /*itemWidth:10,
	        itemHeight:10,*/
	        textStyle:{
	            color:'#ddd',
	            fontSize:14
	        },
	       top:'95%',
	        //bottom:'5%'
	    });
	
		echarts.util.each(rawData, function(dataItem, idx) {
			var geoCoord = geoCoordMap[dataItem.name];
			var coord = myChart.convertToPixel('geo', geoCoord);
			idx += '';
			
			options.xAxis.push({
				id : idx,
				gridId : idx,
				type : 'category',
				name : dataItem.name,
				nameStyle : {
					color : '#ddd',
					fontSize : 12
				},
				nameLocation : 'middle',
				nameGap : 3,
				splitLine : {
					show : false
				},
				axisTick : {
					show : false
				},
				axisLabel : {
					show : false
				},
				axisLine : {
					show : false,
					lineStyle : {
						color : '#bbb'
					}
				},
				data : [ dataItem.name ],
			});
			options.yAxis.push({
				id : idx,
				gridId : idx,
				show : false
			});
			options.grid.push({
				id : idx,
				width : 30,
				height : 50,
				left : coord[0] - 15,
				top : coord[1] - 35,
			});
	
			for (var i = 0; i < namearr.length; i++) {
				options.series.push({//循环将每一个区域里的柱形图加入
					name : namearr[i],
					type : 'bar',
					stack : 'bar' + idx,
					xAxisId : idx,
					yAxisId : idx,
					barWidth: 12,
					itemStyle : {
						normal : {
							color : colorarr[i]
						}
					},
					label: {
		                normal: {
		                    show: true,
		                    position: 'inside',
		                    textStyle: {
		                        color: '#fff'
		                    }
		                }
		            },
					data : [ dataItem.value[i] ]
				});
			}
		});
		myChart.on('click',function(params){
	        var flag=false;
	     //alert(params.name);
	     if(params.name=='海州区'){
	         console.log(1);
	     }else if(params.name=='连云区'){
	     	console.log(2);
	     }else if(params.name=='新浦区'){
	     	console.log(3);
	     }else if(params.name=='赣榆县'){
	     	console.log(4);
	     	var str = '<img src="img/Ganyu.png" alt="" /><span class="point" title="企业"></span>';
	     	$("#map").empty().append(str);
	     	$("#map").on("click",".point",function(){
	     		$(".content-right").eq(0).hide();
	     		$(".content-right").eq(1).show();
	     	})
	     }else if(params.name=='灌云县'){
	     	console.log(5);
	     }else if(params.name=='灌南县'){
	     	console.log(6);
	     }else if(params.name == '东海县'){
	     	console.log(7);
	     }
	    })
		myChart.setOption(options);
	}
	setTimeout(function(){
	    renderEachCity();
	},1); 
}

//拆线排名图表
function areaChange(id,title,axisData,valData){
	var echartWidth = $(window).width() * 0.336;
	var echartHeight = $(window).height() * 0.255;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    //backgroundColor: '#394056',
	    title: {
	        text: title,
	        textStyle: {
	            /*fontWeight: 'bold',*/
	            fontSize: 14,
	            color: '#fff'
	        },
	        left: '0%',
	        top: '2%'
	    },
	    tooltip: {
	        trigger: 'axis',
	        formatter: '{b}  <br/> {a} : {c}',
	        axisPointer: {
	            lineStyle: {
	                color: '#fff'
	            }
	        }
	    },
	    legend: {
	        icon: 'rect',
	        itemWidth: 14,
	        itemHeight: 5,
	        itemGap: 13,
	        data: [/*'办结',*/ '纳税额'],
	        right: '4%',
	        top: '4%',
	        textStyle: {
	            fontSize: 12,
	            color: '#fff'
	        }
	    },
	    grid: {
	    	top: '30%',
	        left: '2%',
	        right: '5%',
	        bottom: '0%',
	        containLabel: true
	    },
	    xAxis: [{
	        type: 'category',
	        boundaryGap: true,
	        axisLine: {
	            lineStyle: {
	                color: '#fff'
	            }
	        },
	        axisLabel: {
	            textStyle: {
	                color: '#fff',
	                fontSize: 12
	            },
	            //rotate: 40 //设置x轴文字旋转方向
	        },
	        data: axisData
	    }, {
	        axisPointer: {
	            show: false
	        },
	        axisLine: {
	            lineStyle: {
	                color: '#f3f3f3'
	            }
	        },
	        axisTick: {
	            show: false
	        },
	
	        position: 'bottom',
	        offset: 20,
	        /*data: ['', '', '', '', '', '', '',{
	            value: '周六',
	            textStyle: {
	                align: 'left'
	            }
	        }, '周日']*/
	    }],
	    yAxis: [{
	        type: 'value',
	        name: '单位(百万)',
	        axisTick: {
	            show: false
	        },
	        axisLine: {
	            lineStyle: {
	                color: '#fff'
	            }
	        },
	        axisLabel: {
	            margin: 10,
	            textStyle: {
	                fontSize: 12
	            }
	        },
	        splitLine: {//控制y轴的背景线段
	        	show: true,
	        	lineStyle: {
	        		color: '#aaa',
	        		type: 'dashed'
	        	}
	        },
	    }],
	    series: [/*{
	        name: '办结',
	        type: 'line',
	        smooth: true,
	        symbol: 'circle',
	        symbolSize: 5,
	        showSymbol: true,//显示拆线上的圆点
	        lineStyle: {
	            normal: {
	                width: 1
	            }
	        },
	        areaStyle: {
	            normal: {
	                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                    offset: 0,
	                    color: 'rgba(137, 189, 27, 0.3)'
	                }, {
	                    offset: 0.8,
	                    color: 'rgba(137, 189, 27, 0.8)'
	                }], false),
	                shadowColor: 'rgba(0, 0, 0, 0.1)',
	                shadowBlur: 10
	            }
	        },
	        itemStyle: {
	            normal: {
	                color: '#ffc72b',
	                borderColor: 'rgba(137,189,2,0.27)',
	                borderWidth: 12
	
	            }
	        },
	        data: [220, 182, 191, 134, 150, 120, 110, 157, 213, 321, 432, 190]
	    },*/ {
	        name: '纳税额',
	        type: 'line',
	        smooth: true,
	        symbol: 'circle',
	        symbolSize: 5,
	        showSymbol: true,//显示拆线上的圆点
	        lineStyle: {
	            normal: {
	                width: 1
	            }
	        },
	        areaStyle: {
	            normal: {
	                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                    offset: 0,
	                    color: 'rgba(235,41,125, 0.3)'//起始颜色
	                }, {
	                    offset: 0.8,
	                    color: 'rgba(235,41,125, 0.6)'//结束颜色
	                }], false),
	                shadowColor: 'rgba(0, 0, 0, 0.1)',
	                shadowBlur: 10
	            }
	        },
	        itemStyle: {
	            normal: {
	                color: 'rgba(235,41,125,1)',
	                borderColor: 'rgba(235,41,125,0.2)',
	                borderWidth: 12
	
	            }
	        },
	        data: valData
	    }]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}
//企业用能月分布情况
function powerUsage(id){
	var echartWidth = $(window).width() * 0.336;
	var echartHeight = $(window).height() * 0.255;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var data = [{
	    "name": "1月",
	    "value": 56.65
	}, {
	    "name": "2月",
	    "value": 87.8
	}, {
	    "name": "3月",
	    "value": 81.3
	}, {
	    "name": "4月",
	    "value": 80
	}, {
	    "name": "5月",
	    "value": 80
	}, {
	    "name": "6月",
	    "value": 80
	}, {
	    "name": "7月",
	    "value": 80
	}];
	var xData = [],
	    yData = [];
	var min = 50; // 最小值的定义
	data.map(function(a, b) {
	    xData.push(a.name);
	    if (a.value === 0) {
	        yData.push(a.value + min);
	    } else {
	        yData.push(a.value);
	    }
	    // yData.push((Math.random(0,1) * 100).toFixed(0));
	});
	var options = {
	    //backgroundColor:"#111c4e",
	    color: ['#3398DB'],
	    title: {
	        text: '企业月用能情况',
	        textStyle: {
	            /*fontWeight: 'bold',*/
	            fontSize: 14,
	            color: '#fff'
	        },
	        left: '0%',
	        top: '2%'
	    },
	    tooltip: {
	        trigger: 'axis',
	        axisPointer: {
	            type: 'line',
	            lineStyle: {
	                opacity: 0
	            }
	        },
	        formatter: function(prams) {
	            if (prams[0].data === min) {
	                return "用电量：0%"
	            } else {
	                return "用电量：" + prams[0].data + "度"
	            }
	        }
	    },
	    legend: {
	        data: ['直接访问', '背景'],
	        show: false
	    },
	    grid: {
	        left: '0%',
	        right: '0%',
	        bottom: '5%',
	        top: '15%',
	        //height: '85%',
	        containLabel: true,
	        z: 22
	    },
	    xAxis: [{
	        type: 'category',
	        gridIndex: 0,
	        data: xData,
	        axisTick: {
	            alignWithLabel: true
	        },
	        axisLine: {
	            lineStyle: {
	                color: '#0c3b71'
	            }
	        },
	        axisLabel: {
	            show: true,
	             color: 'rgb(170,170,170)',
	             fontSize: 12
	        }
	    }],
	    yAxis: [{
	            type: 'value',
	            gridIndex: 0,
	            splitLine: {
	                show: false
	            },
	            axisTick: {
	                show: false
	            },
	            min: min,
	            max: 100,
	            axisLine: {
	                lineStyle: {
	                    color: '#0c3b71'
	                }
	            },
	            axisLabel: {
	                color: 'rgb(170,170,170)',
	                formatter: '{value} %'
	            }
	        },
	        {
	            type: 'value',
	            gridIndex: 0,
	            min: min,
	            max: 100,
	            splitNumber: 12,
	            splitLine: {
	                show: false
	            },
	            axisLine: {
	                show: false
	            },
	            axisTick: {
	                show: false
	            },
	            axisLabel: {
	                show: false
	            },
	            splitArea: {
	                show: true,
	                areaStyle: {
	                    color: ['rgba(250,250,250,0.0)', 'rgba(250,250,250,0.05)']
	                }
	            }
	        }
	    ],
	    series: [{
	            name: '合格率',
	            type: 'bar',
	            barWidth: '30%',
	            xAxisIndex: 0,
	            yAxisIndex: 0,
	            itemStyle: {
	                normal: {
	                    barBorderRadius: [30, 30, 0, 0],
	                    color: new echarts.graphic.LinearGradient(
	                        0, 0, 0, 1, [{
	                                offset: 0,
	                                color: '#00feff'
	                            },
	                            {
	                                offset: 0.5,
	                                color: '#027eff'
	                            },
	                            {
	                                offset: 1,
	                                color: '#0286ff'
	                            }
	                        ]
	                    )
	                }
	            },
	            data: yData,
	            zlevel: 11
	
	        },
	        {
	            name: '背景',
	            type: 'bar',
	            barWidth: '50%',
	            xAxisIndex: 0,
	            yAxisIndex: 1,
	            barGap: '-135%',
	            data: [100, 100, 100, 100, 100, 100, 100],
	            itemStyle: {
	                normal: {
	                    color: 'rgba(255,255,255,0.1)'
	                }
	            },
	            zlevel: 9
	        },
	      
	    ]
	};
	

	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

//产业分布柱形图
function industryBar(id){
	var echartWidth = $(window).width() * 0.176;
	var echartHeight = $(window).height() * 0.30;
	
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight
	});
	
	options = {
		title: {
            text:'产业分布', 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
		color:["#ed4743","#54ba9b","#f48b38","#35acfe"],
	    tooltip : {
	        trigger: 'axis',
	        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
	            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
	        }
	    },
	    legend: {
	        x : 'center',
	        bottom: '2%',
	        itemWidth: 14,
	        itemHeight: 6,
	        textStyle:{
	        	color:'#fff'
	        },
	        data:['三产','二产','一产']
	    },
	    yAxis : [
	        {
	            type : 'value',
	            axisLine : {
	            	lineStyle:{
	            		color: '#fff'
	            	}
	            },
	            splitLine: {
		            show: false
		        },
	        }
	    ],
	    xAxis: [
	        {
	            type : 'category',
	            axisLine : {
	            	lineStyle:{
	            		color: '#fff'
	            	}
	            },
	            data : ['海州区','新浦区','连云区','赣榆县','灌云县','东海县','灌南县'],
		        
	        }
	    ],
	    grid:{
	    	top: '15%',
	        left: '3%',
	        right: '4%',
	        bottom: '15%',
	        containLabel: true
	    },
	    series : [
	        
	        {
	            name:'三产',
	            type:'bar',
	            stack: '总量',
	            //itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
	            data:[120, 132, 101, 134, 132, 101, 134],
	            barWidth:"15",
	        },
	        {
	            name:'二产',
	            type:'bar',
	            stack: '总量',
	            //itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
	            data:[220, 182, 191, 234, 182, 191, 234],
	            barWidth:"15",
	        },
	        {
	            name:'一产',
	            type:'bar',
	            stack: '总量',
	            //itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
	            data:[150, 212, 201, 154, 212, 201, 154],
	            barWidth:"15",
	        }
	    ]
	}
	myChart.setOption(options);
}
//企业规模分布饼图
function scope(id){
	var echartWidth = $(window).width() * 0.188;
	var echartHeight = $(window).height() * 0.30;
	
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight
	});
	
	options = {
		title: {
            text:'规模分布', 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
		color:["#ed4743","#54ba9b","#f48b38","#35acfe","#CF4BA7"],
	    tooltip : {
	        trigger: 'item',
	        formatter: "{a} <br/>{b} : {c} ({d}%)"
	    },
	    legend: {
	        x : 'center',
	        left: '0%',
	        right: '0%',
	        bottom: '2%',
	        itemWidth: 14,
	        itemHeight: 8,
	        itemGap: 10,
	        textStyle:{
	        	color:'#fff'
	        },
	        data:['5千万以下','5千万~2亿','2亿~10亿','10亿~80亿','80亿以上']
	    },
	    series : [
	        {
	            name:'规模分布',
	            type:'pie',
	            radius : '55%',
	            center: ['50%', '45%'],
	            itemStyle : {
	                normal : {
	                    label : {
	                        show : true,
	                        position : 'inner',
	                        textStyle : {
	                            fontSize : '10'
	                        },
	                        formatter:"{d}%"
	                    },
	                    labelLine : {
	                        show : true
	                    }
	                }
	            },
	            data:[
	                {value:335, name:'5千万以下'},
	                {value:310, name:'5千万~2亿'},
	                {value:234, name:'2亿~10亿'},
	                {value:135, name:'10亿~80亿'},
	                {value:95, name:'80亿以上'}
	            ]
	        }
	    ]
	}
	myChart.setOption(options);
}

//企业性质分布柱图
function nature(id){
	var echartWidth = $(window).width() * 0.176;
	var echartHeight = $(window).height() * 0.30;
	
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight
	});
	
	options = {
		title: {
            text:'企业性质', 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
	    color: ['#3398DB'],
	    tooltip : {
	        trigger: 'axis',
	        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
	            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
	        }
	    },
	    grid: {
	    	top: '15%',
	        left: '3%',
	        right: '4%',
	        bottom: '3%',
	        containLabel: true
	    },
	    xAxis : [
	        {
	            type : 'category',
	            data : ['国企', '股份', '私企', '外资', '合资', '集体', '民营'],
	            axisTick: {
	                alignWithLabel: true
	            },
	            axisLine : {
	            	lineStyle:{
	            		color: '#fff'
	            	}
	            },
	        }
	    ],
	    yAxis : [
	        {
	            type : 'value',
	            axisLine : {
	            	lineStyle:{
	            		color: '#fff'
	            	}
	            },
	            splitLine: {
		            show: false
		        },
	        }
	    ],
	    series : [
	        {
	            name:'直接访问',
	            type:'bar',
	            barWidth: '60%',
	            data:[310, 252, 200, 134, 120, 90, 80]
	        }
	    ]
	};
	myChart.setOption(options);
}
//产值分布柱形图表
function taxRank(id,dataArr,num,title){
	var echartWidth = $(window).width() * 0.176;
	var echartHeight = $(window).height() * 0.30;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	//var dataAll = [389, 259, 262, 324, 232, 176, 196, 214, 133, 370];
	//var yAxisData = ['原因1','原因2','原因3','原因4','原因5','原因6','原因7','原因8','原因9','原因10'];
	function numDescSort(a,b){//进行降序排序操作
		return a.value - b.value;
	}
	var convertData = dataArr;//数据
	var dataTitle = [];//标题
	convertData.sort(numDescSort);//对数据进行排序操作
	for(var i = 0 ;i < convertData.length; i++){
		dataTitle.push(convertData[i].name);
	}
	//定义不同的渐变色
	function colors(num){
		var color;
		if(num ==1){
			color = new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
            "offset": 0,
            "color": "#ffb069" // 0% 处的颜色
        }, {
            "offset": 1,
            "color": "#ec2e85" // 100% 处的颜色
        }], false)
		}else if(num ==2){
			color = new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
	            offset: 0,
	            color: '#96d668'
	        }, {
	            offset: 1,
	            color: '#01babc'
	        }], false)
		}else{
	        color = new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
	            offset: 0,
	            color: '#1a98f8'
	        }, {
	            offset: 1,
	            color: '#7049f0'
	        }], false)
        }
		return color;
	}

	var options = {
	    title: {
            text:title, 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
	    "tooltip": {
	        "trigger": "axis",
	        "axisPointer": { // 坐标轴指示器，坐标轴触发有效
	            "type": "shadow" // 默认为直线，可选为："line" | "shadow"
	        }
	    },
	    "grid": {
	    	"top": "15%",
	        "left": "3%",
	        "right": "10%",
	        "bottom": "5%",
	        "containLabel": true
	    },
	    "yAxis": [{
	        "type": "category",
	        "data": dataTitle,
	        "axisLine": {
	            "show": true,
	            "lineStyle":{
	            	"color": '#ffffff'
	            }
	            
	        },
	        "axisTick": {
	            "show": false,
	            "alignWithLabel": true
	        },
	        "axisLabel": {
	            "textStyle": {
	                "color": "#ffb069"
	            }
	        }
	    }],
	    "xAxis": [{
	        "type": "value",
	        "axisLine": {
	            "show": false
	        },
	        "axisTick": {
	            "show": false
	        },
	        "axisLabel": {
	            "show": false
	        },
	        "splitLine": {
	            "show": false
	        }
	    }],
	
	    "series": [{
	        "name": "税收额",
	        "type": "bar",
	        "data": convertData,
	        "barCategoryGap": "35%",
	        "label": {
	            "normal": {
	                "show": true,
	                "position": "right",
	                "formatter": function(params) {
	                    return params.data.value;
	                },
	                "textStyle": {
	                    "color": "#bcbfff" //color of value
	                }
	            }
	        },
	        "itemStyle": {
	            "normal": {
	                /*"color": new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
	                    "offset": 0,
	                    "color": "#ffb069" // 0% 处的颜色
	                }, {
	                    "offset": 1,
	                    "color": "#ec2e85" // 100% 处的颜色
	                }], false)*/
	               "color": colors(num)
	            }
	        }
	    }]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

//投资图谱关系图表
function relationGap(id){
	var echartWidth = $(window).width() * 0.356;
	var echartHeight = $(window).height() * 0.650;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    /*backgroundColor: new echarts.graphic.RadialGradient(0.3, 0.3, 0.8, [{
	        offset: 0,
	        color: '#f7f8fa'
	    }, {
	        offset: 1,
	        color: '#cdd0d5'
	    }]),*/
	    title: {
	        text: "投资图谱",
	   		textStyle:{
	   			color: "#fff"
	   		},
	        top: "top",
	        left: "center"
	    },
	    color:["#ed4743","#54ba9b","#f48b38","#35acfe","#CF4BA7"],
	    tooltip: {},
	    legend: [{
	        
	        tooltip: {
	            show: true
	        },
	        textStyle: {
	        	color:'#fff'
	        },
	        selectedMode: 'false',
	        bottom: 20,
	        data: ['股东', '对外投资']
	    }],
	    
	    animationDuration: 3000,
	    animationEasingUpdate: 'quinticInOut',
	    series: [{
	        name: '投资图谱',
	        type: 'graph',
	        layout: 'force',
	
	        force: {
	            repulsion: 300
	        },
	        data: [{
	            "name": "艾博机器人公司",
	            // "x": 0,
	            // y: 0,
	            "symbolSize": 50,
	            "draggable": "true",
	            "value": 27,
	            "itemStyle":{
	            	color: "#fff"
	            }
	
	        }, {
	            "name": "股东",
	            "value": 15,
	            "symbolSize": 30,
	            "category": "股东",
	            "draggable": "true"
	        }, {
	            "name": "股东2",
	            "symbolSize": 15,
	            "category": "股东",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "股东3",
	            "symbolSize": 15,
	            "category": "股东",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "股东4",
	            "symbolSize": 15,
	            "category": "股东",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "股东5",
	            "symbolSize": 15,
	            "category": "股东",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "股东6",
	            "symbolSize": 15,
	            "category": "股东",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "对外投资",
	            "value": 60,
	            "symbolSize": 30,
	            "category": "对外投资",
	            "draggable": "true"
	        }, {
	            "name": "公司1",
	            "symbolSize": 15,
	            "category": "对外投资",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "公司2",
	            "symbolSize": 15,
	            "category": "对外投资",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "公司3",
	            "symbolSize": 15,
	            "category": "对外投资",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "公司4",
	            "symbolSize": 15,
	            "category": "对外投资",
	            "draggable": "true",
	            "value": 1
	        }],
	        links: [{
	            "source": "艾博机器人公司",
	            "target": "股东"
	        }, {
	            "source": "股东",
	            "target": "股东1"
	        }, {
	            "source": "股东",
	            "target": "股东2"
	        }, {
	            "source": "股东",
	            "target": "股东3"
	        }, {
	            "source": "股东",
	            "target": "股东4"
	        }, {
	            "source": "股东",
	            "target": "股东5"
	        }, {
	            "source": "股东",
	            "target": "股东6"
	        }, {
	            "source": "艾博机器人公司",
	            "target": "对外投资"
	        }, {
	            "source": "对外投资",
	            "target": "公司1"
	        }, {
	            "source": "对外投资",
	            "target": "公司2"
	        }, {
	            "source": "对外投资",
	            "target": "公司3"
	        }, {
	            "source": "对外投资",
	            "target": "公司4"
	        }],
	        categories: [{
	            'name': '股东'
	        }, {
	            'name': '对外投资'
	        }],
	        focusNodeAdjacency: true,
	        roam: true,
	        label: {
	            normal: {
	
	                show: true,
	                position: 'top',
	
	            }
	        },
	        lineStyle: {
	            normal: {
	                color: 'source',
	                curveness: 0,
	                type: "solid"
	            }
	        }
	    }]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}
//产业链关系图表
function propertyGap(id){
	var echartWidth = $(window).width() * 0.356;
	var echartHeight = $(window).height() * 0.650;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    /*backgroundColor: new echarts.graphic.RadialGradient(0.3, 0.3, 0.8, [{
	        offset: 0,
	        color: '#f7f8fa'
	    }, {
	        offset: 1,
	        color: '#cdd0d5'
	    }]),*/
	    title: {
	        text: "产业链关系图",
	   		textStyle:{
	   			color: "#fff"
	   		},
	        top: "top",
	        left: "center"
	    },
	    color:["#ed4743","#54ba9b","#f48b38","#35acfe","#CF4BA7"],
	    tooltip: {},
	    legend: [{
	        
	        tooltip: {
	            show: true
	        },
	        textStyle: {
	        	color:'#fff'
	        },
	        selectedMode: 'false',
	        bottom: 20,
	        data: ['股东', '对外投资']
	    }],
	    
	    animationDuration: 3000,
	    animationEasingUpdate: 'quinticInOut',
	    series: [{
	        name: '产业链关系图',
	        type: 'graph',
	        layout: 'force',
	
	        force: {
	            repulsion: 300
	        },
	        data: [{
	            "name": "艾博机器人公司",
	            // "x": 0,
	            // y: 0,
	            "symbolSize": 50,
	            "draggable": "true",
	            "value": 27,
	            "itemStyle":{
	            	color: "#fff"
	            }
	
	        }, {
	            "name": "股东",
	            "value": 15,
	            "symbolSize": 30,
	            "category": "股东",
	            "draggable": "true"
	        }, {
	            "name": "股东2",
	            "symbolSize": 15,
	            "category": "股东",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "股东3",
	            "symbolSize": 15,
	            "category": "股东",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "股东4",
	            "symbolSize": 15,
	            "category": "股东",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "股东5",
	            "symbolSize": 15,
	            "category": "股东",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "股东6",
	            "symbolSize": 15,
	            "category": "股东",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "对外投资",
	            "value": 60,
	            "symbolSize": 30,
	            "category": "对外投资",
	            "draggable": "true"
	        }, {
	            "name": "公司1",
	            "symbolSize": 15,
	            "category": "对外投资",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "公司2",
	            "symbolSize": 15,
	            "category": "对外投资",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "公司3",
	            "symbolSize": 15,
	            "category": "对外投资",
	            "draggable": "true",
	            "value": 1
	        }, {
	            "name": "公司4",
	            "symbolSize": 15,
	            "category": "对外投资",
	            "draggable": "true",
	            "value": 1
	        }],
	        links: [{
	            "source": "艾博机器人公司",
	            "target": "股东"
	        }, {
	            "source": "股东",
	            "target": "股东1"
	        }, {
	            "source": "股东",
	            "target": "股东2"
	        }, {
	            "source": "股东",
	            "target": "股东3"
	        }, {
	            "source": "股东",
	            "target": "股东4"
	        }, {
	            "source": "股东",
	            "target": "股东5"
	        }, {
	            "source": "股东",
	            "target": "股东6"
	        }, {
	            "source": "艾博机器人公司",
	            "target": "对外投资"
	        }, {
	            "source": "对外投资",
	            "target": "公司1"
	        }, {
	            "source": "对外投资",
	            "target": "公司2"
	        }, {
	            "source": "对外投资",
	            "target": "公司3"
	        }, {
	            "source": "对外投资",
	            "target": "公司4"
	        }],
	        categories: [{
	            'name': '股东'
	        }, {
	            'name': '对外投资'
	        }],
	        focusNodeAdjacency: true,
	        roam: true,
	        label: {
	            normal: {
	
	                show: true,
	                position: 'top',
	
	            }
	        },
	        lineStyle: {
	            normal: {
	                color: 'source',
	                curveness: 0,
	                type: "solid"
	            }
	        }
	    }]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

//企业纳税分布柱图
function enterpriseTax(id){
	var echartWidth = $(window).width() * 0.356;
	var echartHeight = $(window).height() * 0.650;
	
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight
	});
	
	options = {
		title: {
            text:'企业纳税情况', 
            textStyle:{
	   			color: "#fff"
	   		},
	        top: "top",
	        left: "center"
        },
	    color: ['#3398DB'],
	    tooltip : {
	        trigger: 'axis',
	        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
	            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
	        }
	    },
	    grid: {
	    	top: '15%',
	        left: '3%',
	        right: '4%',
	        bottom: '3%',
	        containLabel: true
	    },
	    xAxis : [
	        {
	            type : 'category',
	            data : ['2011年', '2012年', '2013年', '2014年', '2015年', '2016年', '2017年'],
	            axisTick: {
	                alignWithLabel: true
	            },
	            axisLine : {
	            	lineStyle:{
	            		color: '#fff'
	            	}
	            },
	        }
	    ],
	    yAxis : [
	        {
	            type : 'value',
	            axisLine : {
	            	lineStyle:{
	            		color: '#fff'
	            	}
	            },
	            splitLine: {
		            show: false
		        },
	        }
	    ],
	    series : [
	        {
	            name:'纳税',
	            type:'bar',
	            barWidth: '60%',
	            data:[310, 252, 220, 334, 420, 390, 480]
	        }
	    ]
	};
	myChart.setOption(options);
}

//企业用能分布拆线图
function energyUsage(id){
	var echartWidth = $(window).width() * 0.356;
	var echartHeight = $(window).height() * 0.650;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    //backgroundColor:'#fff',
	    title: {
            text:'用能统计', 
            textStyle:{
	   			color: "#fff"
	   		},
	        top: "top",
	        left: "center"
        },
	    tooltip : {
	        trigger: 'axis',
	        formatter: '用能：{b} <br> 数量： {c}瓦'
	    },
	    legend: {
	    	right: '4%',
	    	textStyle: {
	    		color: '#fff'
	    	},
	        data:['用能']
	    },
	     grid: {
	        left: '3%',
	        right: '5%',
	        top:'15%',
	        bottom: '5%',
	        containLabel: true
	    },
	    color:['#fbceb2','#dbb0e3'],
	    calculable : true,
	    xAxis : [
	        {
	            type : 'category',
	            boundaryGap : false,
	            axisLine: {
		        	//show: false,
		            lineStyle: {
		                color: '#FFFFFF'
		            }
		        },
	            data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
	        },
	        
	    ],
	    yAxis : [{
            //name:'投诉立案数',
            type : 'value',
            axisLine: {
	        	//show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        },
	        splitLine: {
	        	show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        }
    	},
	    ],
	    series : [
	        {
	            name:'用能',
	            type:'line',
	            areaStyle: {
	                normal: {type: 'default',
	                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                        offset: 0,
	                        color: 'rgba(199, 37, 50,0.2)'
	                    }, {
	                        offset: 1,
	                        color: 'rgba(199, 37, 50,0.8)'
	                    }], false)
	                }
	            },
	            smooth:true,
	            itemStyle: {
	                normal: {areaStyle: {type: 'default'}}    
	            },
	            data:[180, 167, 421, 350, 405, 260, 490, 190, 187, 245, 315, 254]
	        }
	    ]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}